﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeBehind="EditStory.aspx.cs" Inherits="Nivdal.EditStory" StylesheetTheme="SkinFile" %>
   
<%@ Register Assembly="obout_Flyout2_NET" Namespace="OboutInc.Flyout2" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="RedTitleLabel" runat="server" Text="<%$ Resources:Resource, EditStory_PageTitle %>" CssClass="white_title"></asp:Label>
    </div>
    <div class="padding5">
        <asp:Label ID="MessageLabel" runat="server" Text="" SkinID="GreenSmallHeaderLabel"></asp:Label><br />
    
    
    
        <asp:FormView ID="StoryFormView" DataSourceID="StorySqlDataSource" runat="server">
            <ItemTemplate>
                <asp:HyperLink ID="StoryHyperlink" runat="server" SkinID="WallHyperlink" Text='<%# Eval("Title") %>'
                    NavigateUrl='<%# "~/Story.aspx?StoryId=" + Eval("StoryId") %>'></asp:HyperLink>
                <br />
                <br />
                <asp:Label ID="StoryTitleLabel" runat="server" Text="<%$ Resources:Resource, NewsPaper_StoryTitleLabel %>"
                    SkinID="InfoLabel"></asp:Label>
                <br />
                <asp:TextBox ID="StoryTitleTextBox" runat="server" Text='<%# Eval("Title") %>' MaxLength="128"
                    Width="400px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="StoryTitleRequiredFieldValidator" runat="server"
                    ErrorMessage="*" ControlToValidate="StoryTitleTextBox" SetFocusOnError="True"
                    ValidationGroup="UpdateStoryTitle"></asp:RequiredFieldValidator>
                <br />
                <asp:Button runat="server" Text="<%$ Resources:Resource, Story_UpdateStoryTitle %>"
                    CssClass="GreenSmallButtonStyle" ID="UpdateStoryTitle" ValidationGroup="UpdateStoryTitle"
                    OnClick="UpdateStoryTitle_Click" />
                <br />
                <br />
                <asp:Label ID="EditRubricTitleLabel" runat="server" SkinID="InfoLabel"
                 Text="<%$ Resources:Resource, NewsPaper_RubricTitle %>"></asp:Label>
                <asp:DropDownList ID="RubricsDDL" runat="server" DataSourceID="RubricsSqlDataSource" DataTextField="Name" DataValueField="Id"></asp:DropDownList>
                <asp:Button ID="SetRubricButton" runat="server" OnClick="UpdateRubric" 
                Text="<%$ Resources:Resource, Global_Set %>" CssClass="GreenSmallButtonStyle" />
            
            
                <br />
                <br />
                <asp:Label ID="SubTitileLabel" runat="server" Text="<%$ Resources:Resource, NewsPaper_StorySubTitleLabel %>"
                    SkinID="InfoLabel"></asp:Label>
                <br />
                <CustomControls:TextArea ID="StorySubTitleTextBox" runat="server" Text='<%# Eval("SubTitle") %>'
                    MaxLength="256" TextMode="MultiLine" Height="50px" Width="400px"></CustomControls:TextArea>
                <asp:RequiredFieldValidator ID="SubTitleRequiredFieldValidator" runat="server" ErrorMessage="*"
                    ControlToValidate="StorySubTitleTextBox" SetFocusOnError="True" ValidationGroup="UpdateStorySubTitle"></asp:RequiredFieldValidator>
                <br />
                <br />
                <asp:Button runat="server" Text="<%$ Resources:Resource, EditStory_UpdateStorySubTitle %>"
                    CssClass="GreenSmallButtonStyle" ID="UpdateStorySubTitle" ValidationGroup="UpdateStorySubTitle"
                    OnClick="UpdateStorySubTitle_Click" />
                <br />
                <br />
                <asp:Image ID="StoryImage" runat="server" Width="150px" ImageUrl='<%# Eval("image") %>' />
                <br />
                <br />
                <asp:FileUpload ID="imgUpload" runat="server" />
                <br />
                <asp:Button runat="server" Text="<%$ Resources:Resource, EditStory_UpdateImage %>"
                    CssClass="GreenSmallButtonStyle" ID="UpdateImageButton" ValidationGroup="UpdateStorySubTitle"
                    OnClick="UpdateImageButton_Click" />
                <br />
                <br />
                <asp:Label ID="StoryTextTitleLabel" runat="server" Text="<%$ Resources:Resource, NewsPaper_StoryTextLabel %>"
                    SkinID="InfoLabel"></asp:Label>
                <asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <CustomControls:TextArea ID="Storyeditor" runat="server" MaxLength="40000" TextMode="MultiLine"
                            Text='<%# GetStoryText() %>' Rows="3" Height="150px" Width="500"></CustomControls:TextArea>
                    
                        <%--<asp:Image ID="HelpImage" runat="server" ImageUrl="~/Images/question.gif" AlternateText="help" />
                        <cc1:Flyout ID="Help" runat="server" NoneEffect="true" AttachTo="HelpImage">
                            <div class="ToolTipStyle">
                                <asp:Label ID="TextHelpLabel" runat="server" Text='<%# EditorHelp() %>'></asp:Label>
                            </div>
                        </cc1:Flyout>--%>
                        <br />
                        <asp:Label ID="PreviewLabel" CssClass="HtmlPreview" runat="server" Text=""></asp:Label>
                    </ContentTemplate>
                </asp:UpdatePanel>

                <asp:RequiredFieldValidator ID="StoryeditorRequiredFieldValidator" runat="server"
                    ErrorMessage="*" ControlToValidate="Storyeditor" SetFocusOnError="True" ValidationGroup="UpdateStoryText"></asp:RequiredFieldValidator>
                <asp:Button runat="server" Text="<%$ Resources:Resource, EditStory_UpdateStoryText %>"
                    CssClass="GreenSmallButtonStyle" ID="UpdateStoryText" ValidationGroup="UpdateStoryText"
                    OnClick="UpdateStoryText_Click" />
                &nbsp;&nbsp;&nbsp;
                <asp:Button ID="Button2" OnClick="Button2_Click" runat="server" Text="<%$ Resources:Resource, Global_Preview %>"
                    CssClass="GreySmallButtonStyle" />
            </ItemTemplate>
        </asp:FormView>
                 
        <asp:SqlDataSource ID="StorySqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_ShowStory" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:QueryStringParameter Name="StoryId" QueryStringField="StoryId" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="RubricsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_GetListOfActiveRubrics" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
    </div>
    </div>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, Story_EditStory %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
